const jwt = require('jsonwebtoken');
class AuthController {
    async login(ctx, next) {
      const { id, phone, username,address } = ctx.user;
      let userInfo = { ...ctx.user };
      userInfo.password=""
      const token = jwt.sign({ id, phone,username }, "token", {
        expiresIn: 60 * 60 * 24,
      });
      let status = 200;
      let message="登录成功"
      ctx.body = { userInfo,token,status,message }
  }
}

module.exports = new AuthController();
